package eop.project;
import eop.project.Eruption;

import grails.test.*

class EruptionTest extends GrailsUnitTestCase {
    protected void setUp() {
        super.setUp()
    }

    protected void tearDown() {
        super.tearDown()
    }

    void testSomething() {
		mockDomain (Eruption)
		mockDomain(Damage)
		mockDomain (Activity)
		Eruption e=new Eruption(vei:"",agent:'',startDate:"",endDate:"",eventDate:"2010-05-29")
		e.damage=new Damage(injuries:"21",Houses:"23",numberOfDeaths:"",damages:"")
		Activity a=new Activity(vaac:'Darwin',color:'red')
		e.addToActivities(a).save()
		e.validate()
		if(e.hasErrors()){
			e.errors.each{ println "volcano error : $it" }
		}
		else
			println "no errors"
		e.save()

    }
}
